<article id="wikiArticle">
<div></div>
<h2 id="概要">概要</h2>
<p><code><strong>TypedArray.BYTES_PER_ELEMENT</strong></code> 属性代表了强类型数组中每个元素所占用的字节数。</p>
<div><table class="standard-table">
<thead>
<tr>
<th class="header" colspan="2"><code>TypedArray.BYTES_PER_ELEMENT</code> 属性的属性特性：</th>
</tr>
</thead>
<tbody>
<tr>
<td>writable</td>
<td>false</td>
</tr>
<tr>
<td>enumerable</td>
<td>false</td>
</tr>
<tr>
<td>configurable</td>
<td>false</td>
</tr>
</tbody>
</table></div>
<h2 id="语法">语法</h2>
<pre><code class="language-javascript">TypedArray.BYTES_PER_ELEMENT;</code></pre>
<h2 id="描述">描述</h2>
<p>强类型数组对象用来解释为单个元素的字节数是不一样的。常量 <code>BYTES_PER_ELEMENT</code> 表示了特定强类型数组中每个元素所占用的字节数。</p>
<h2 id="示例">示例</h2>
<pre><code class="language-js">Int8Array.BYTES_PER_ELEMENT;         // 1
Uint8Array.BYTES_PER_ELEMENT;        // 1
Uint8ClampedArray.BYTES_PER_ELEMENT; // 1
Int16Array.BYTES_PER_ELEMENT;        // 2
Uint16Array.BYTES_PER_ELEMENT;       // 2
Int32Array.BYTES_PER_ELEMENT;        // 4
Uint32Array.BYTES_PER_ELEMENT;       // 4
Float32Array.BYTES_PER_ELEMENT;      // 4
Float64Array.BYTES_PER_ELEMENT;      // 8</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">备注</th>
</tr>
<tr>
<td><a class="external" href="https://www.khronos.org/registry/typedarray/specs/latest/#7" rel="noopener">Typed Array Specification</a></td>
<td>已过期</td>
<td><span><span>被ECMAScript 6取代</span></span></td>
</tr>
<tr>
<td><a class="external" href="https://www.ecma-international.org/ecma-262/6.0/#sec-typedarray.bytes_per_element" hreflang="en" lang="en" rel="noopener">ECMAScript 2015 (6th Edition, ECMA-262)<br/><small lang="zh-CN">TypedArray.BYTES_PER_ELEMENT</small></a></td>
<td><span class="spec-Standard">Standard</span></td>
<td>Initial definition in an ECMA standard.</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p></p><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
            This compatibility table still uses the old format,
            because we haven't yet converted the data it contains.
            <strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div><p></p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>功能</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>基本支持</td>
<td>7.0</td>
<td><a href="/en-US/Firefox/Releases/4" title="Released on 2011-03-22.">4.0</a> (2)</td>
<td>10</td>
<td>11.6</td>
<td>5.1</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>功能</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>基本支持</td>
<td>4.0</td>
<td><span style="color: #888;" title="Please update this with the earliest version of support.">(Yes)</span></td>
<td>4.0 (2)</td>
<td>10</td>
<td>11.6</td>
<td>4.2</td>
</tr>
</tbody>
</table>
</div>
<h2 id="sect1"> </h2>
<h2 id="参见">参见</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Typed_arrays" title="en/JavaScript typed arrays">JavaScript 强类型数组</a></li>
<li><a href="Reference/Global_Objects/TypedArray" title="一个TypedArray 对象描述一个底层的二进制数据缓存区的一个类似数组(array-like)视图。事实上，没有名为 TypedArray的全局对象，也没有一个名为的 TypedArray构造函数。相反，有许多不同的全局对象，下面会列出这些针对特定元素类型的类型化数组的构造函数。在下面的页面中，你会找到一些不管什么类型都公用的属性和方法。"><code>TypedArray</code></a></li>
</ul>
</article>